/**
 * 学生模块路由文件
 */

const Router = require('koa-router');
const router = new Router();
const { validAdd, validUpdate, validChange, validSearch, validChangeRecord, validSearchArchives, validAddFee, validSearchFee } = require('../validators/students');
const { validate } = require('../validators/common');
const { add, update, change, search, updateRecord, searchArchives, addStudentFee, searchStudentFee } = require('../services/students');

router.prefix('/students');

router.post('/add', validate(validAdd), add);

router.put('/update', validate(validUpdate), update);

router.put('/change', validate(validChange), change);

router.get('/search', validate(validSearch), search);

router.put('/record', validate(validChangeRecord), updateRecord);

router.get('/searchArchives', validate(validSearchArchives), searchArchives);

router.post('/addFee', validate(validAddFee), addStudentFee);

router.get('/searchFee', validate(validSearchFee), searchStudentFee);

module.exports = router;